package test0928.deepclone2;

public class Driver extends Person {
    private Car car;

    public Driver(Car car) {
        this.car = car;
    }

    public Driver(String name, int age, Car car) {
        super(name, age);
        this.car = car;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    @Override
    public String toString() {
        return "Driver{" +super.toString()+
                "car=" + car +
                '}';
    }
}
